home *** CD-ROM | disk | FTP | other *** search
/ stazsoftware.com / www.stazsoftware.com.tar / www.stazsoftware.com / futurebasic / sample-code / helpProj.sit / Help Project Folder / Help / 2 List Display < prev    next >
Text File  |  2005-04-15  |  5KB  |  87 lines

  1. <HTML>  
  2. <HEAD>
  3.   <TITLE>2 Recent Changes</TITLE>
  4. </HEAD>
  5. <BODY BGCOLOR="#ffffff">
  6.  
  7. <B><FONT COLOR="#0000ff"><IMG SRC="Images/Dabs%20logo.jpg" WIDTH="118"
  8. HEIGHT="94" ALIGN="BOTTOM" BORDER="0"></FONT></B>
  9.  
  10. <P> </P>
  11.  
  12. <P><B><FONT COLOR="#0000ff">In earlier versions of FB and using
  13. PG we had a very easy to use method of creating and viewing lists.
  14. To date we don't have an OSX version of that set of commands so
  15. I created this list manager for my own use. It has the ability
  16. to display lists in any desired font, size and color and can also
  17. display small graphics. It uses String Resources for the text
  18. at this point but small modifications could use anything.</FONT></B></P>
  19.  
  20. <P>The first thing to do to create the list is review the record
  21. we create for managing lists and list display. Here is the basics.</P>
  22.  
  23. <P>BEGIN Record ListRecord<BR>
  24. DIM as int            ncols                          'number
  25. of colums<BR>
  26. dim as long      numRecords               'number
  27. of records filled in after first drawing<BR>
  28. dim as int       STResNo                   'Using
  29. a String Resource in this example<BR>
  30. DIM as int     LScrollBtn<BR>
  31. DIM as LONG LScrlBtnMax<BR>
  32. dim as rect        ListRect                     'The
  33. overall rectangle for the list<BR>
  34. DIM as rect      selrect[20]<BR>
  35. DIM as int       colwd%[20]              '20
  36. columns each can have their own width<BR>
  37. Dim as RGBCOLOR RGB[20]           'each
  38. column can have a different color<BR>
  39. DIM as INT    txtalign[20]               'left
  40. = 0, right = 1, center = 2<BR>
  41. DIM as int       oldselect                   'the
  42. list row previously selected<BR>
  43. dim as int        newselect                  'the
  44. new selection if there is one<BR>
  45. dim as int        WhichString              'which
  46. string in the resouce selected<BR>
  47. DIM as INT buttonsized<BR>
  48. dim as int        fnt                               'the
  49. font to use<BR>
  50. dim as int        sze                              'the
  51. size to use<BR>
  52. dim as int        styl                             'the
  53. style to use<BR>
  54. DIM as str255 2 delim$                     'the
  55. delimiting character for each row<BR>
  56. DIM as str255 2 icon$                       'the
  57. delim string noting what follows is an icon id and not a string<BR>
  58. end record<BR>
  59. </P>
  60.  
  61. <P>Using this record format we initialize the list using a local
  62. function to set the above items or get them from a preference
  63. and then set them</P>
  64.  
  65. <P>Two basic functions handle the list from here on.</P>
  66.  
  67. <P>1. DoListSelection$ Detects a mouse click on the list and returns
  68. the text for that cell. It also detects if you moved the mouse
  69. up or down in the list and above or below the list rectangle to
  70. correctly redraw the list.</P>
  71.  
  72. <P>2. DrawList takes the responsibility for drawing the list.
  73. Follow the code and you can see how we set colors for the text
  74. and cells, draw the selected cell and draw an icon with the cell
  75. if you have set the list up that way.</P>
  76.  
  77. <P><B><FONT COLOR="#ff0000">To add new topics you simply drop
  78. them in the Help folder. Each time the help window is displayed
  79. it rebuilds the list of topics from the contents of the Help folder.</FONT></B></P>
  80.  
  81. <P><B><FONT COLOR="#ff0000">Mostly these few help topics are just
  82. for blah, blah to show the help system. More notes exist on the
  83. code.</FONT></B>
  84.  
  85. </BODY>
  86. </HTML>
  87.